#include <stdio.h>

void calculateTriangularNumber(int n) {
  int i,triangularNumber=0;
  for (int i = 1; i <= n; i++) {
    triangularNumber+=i;
  }
  printf("triangular number %i is %i\n", n , triangularNumber );
}

int main(int argc, char const *argv[]) {
  calculateTriangularNumber(10);
  calculateTriangularNumber(20);
  calculateTriangularNumber(50);
  return 0;
}
